package com.example.impl;

import com.example.details.ProviderTestDTO;
import com.example.service.IProviderService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;

/**
 * @author ：songxusheng
 * @date ：Created in 2022/4/7 15:06
 * @description：consumer接口实现类
 * @version: $
 */

@Service
public class ProviderServiceImpl {
    @Reference
    private IProviderService iProviderService;
    public List<ProviderTestDTO> test(){
        return iProviderService.queryList();
    }

    public void upload(MultipartFile file) {
        try {
            iProviderService.uploadFile(file.getBytes(),file.getName(), file.getOriginalFilename(), file.getContentType());
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
